<?php @session_start();?>
<?php
require_once('./safe.php');
require_once('../admin/config.php');
$conn = mysql_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd);
mysql_select_db($cfg_dbname,$conn);
$sql="select * from ph_user where user_name='".$_SESSION["username"]."'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$sqltdk="select * from ph_tdk where 1=1";
$resulttdk=mysql_query($sqltdk);
$rowtdk=mysql_fetch_array($resulttdk);

$sqls="select count(*) as zs from ph_order where userid='".$_SESSION["userid"]."'";
$results=mysql_query($sqls);
$rows=mysql_fetch_array($results);





?>

<!DOCTYPE htm
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

            <link rel="apple-touch-icon" sizes="180x180" href="/images/iosinstalls/favicon/apple-touch-icon.png">
            <meta name="theme-color" content="#ffffff">
        <title><?php echo $rowtdk["sitename"];?> - Dashboard</title>

        <link href="../css/customer-iosinstalls.css?id=a9a9c5930bcdb195e9ee" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="<?php if(!empty($rowtdk["fontlink"])){echo '//fonts.googleapis.com/css?family='.$rowtdk["fontlink"];}else{echo "//fonts.googleapis.com/css?family=Roboto:300,400,500";}?>">
        <style type="text/css">
            body{font-family: '<?php echo $rowtdk["fontlink"];?>';}
        </style>        
   
    </head>

    <body class="app header-fixed sidebar-fixed aside-menu-fixed aside-menu-hidden">
                   
                
    <?php include("head.php");?> 
    <?php include("left.php");?> 

            <!-- Main content -->
            <main class="main">
                
<div class="container-fluid">


    <div class="row margin-top">
        <div class="col-sm-12">
                    </div>

        
        <div class="col-sm-12 ">
            <div class="card">
                <div class="card-header bg-primary">
                    <b>Startup Guide</b>
                </div>
                                    <div class="card-block">
                        Add your App by going to <a href="my-apps.php">My Apps</a>. And put the package/link of the app, into the input field.
                        If you ever face any questions, then just contact us on the Live chat or on our skype: <a href="https://join.skype.com/invite/xs1V4QNCMdh5" target="_blank">Appleaso</a>
                    </div>
                            </div>
        </div>







        <div class="col-sm-12 hidden">
            <div class="card">
                <div class="card-header bg-primary">
                    <b>Free Guidance</b>
                </div>
                <div class="card-block">
                                            If you're in need of any help, regarding a new order, getting a guaranteed rank, or anything else, then just contact us on the Live Chat, Skype (<a href="https://join.skype.com/invite/kDFAPAR40Slg" target="_blank">contact@iosinstalls.com</a>) or at <a href="mailto:contact@iosinstalls.com">contact@iosinstalls.com</a>.<br />
                                    </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6 col-lg-3">
            <div class="card">
                <div class="card-block p-3 clearfix">
                    <i class="icon-credit-card bg-success p-3 font-2xl mr-3 float-left"></i>
                    <div class="text-uppercase text-muted font-weight-bold font-xs mb-0 mt-2">Balance</div>
                    <div class="h5">$<?php echo $row["balance"];?></div>
                </div>
            </div>
        </div>

        <div class="col-sm-6 col-lg-3">
            <div class="card">
                <div class="card-block p-3 clearfix">
                    <i class="fa fa-money-bill-alt bg-info p-3 font-2xl mr-3 float-left"></i>
                    <div class="text-uppercase text-muted font-weight-bold font-xs mb-0 mt-2">Total Top-up</div>
                    <div class="h5">$<?php echo $row["top_up"];?></div>
                </div>
            </div>
        </div>

        <div class="col-sm-6 col-lg-3">
            <div class="card">
                <div class="card-block p-3 clearfix">
                    <i class="icon-docs bg-warning p-3 font-2xl mr-3 float-left"></i>
                    <div class="text-uppercase text-muted font-weight-bold font-xs mb-0 mt-2">Total orders</div>
                    <div class="h5"><?php echo $rows["zs"];?></div>
                </div>
            </div>
        </div>

            </div>

    <div class="row">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header bg-success">
                    <b>Last 5 balance changes</b>
                </div>
                <div class="card-block">
                    <table class="table table-hover mb-0">
                        <thead class="thead-default">
                        <tr>
                            <th>Amount</th>
                            <th>Date</th>
                        </tr>
                        <?php
                        $sqlg="select * from ph_transactions where userid='".$_SESSION["userid"]."' order by ID desc limit 5";
$resultg=mysql_query($sqlg);

 while($rowg=mysql_fetch_array($resultg)){?>
                        <tr>
                            <td><?php echo $rowg["Amount"];?></td>
                            <td><?php echo $rowg["cdate"];?></td>
                        </tr>
                        <?php }?>
                        </thead>
                        <tbody>
                                                </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="col-md-6">
            <div class="card">
                <div class="card-header bg-primary">
                    <b>Last 5 orders</b>
                </div>
                <div class="card-block">
                    <table class="table table-hover mb-0">
                        <thead class="thead-default">
                        <tr>
                            <th>App</th>
                            <th>Price</th>
                            <th>Status</th>
                        </tr>
<?php 
$sqlf="select * from ph_order where userid='".$_SESSION["userid"]."' order by ID desc limit 5";
$resultf=mysql_query($sqlf);
while($rowf=mysql_fetch_array($resultf)){?>
                        <tr>
                            <td><?php echo $rowf["App"];?></td>
                            <td><?php echo $rowf["Price"];?></td>
                            <td><?php echo $rowf["Status"];?></td>
                        </tr>
<?php }?>
                        </thead>
                        <tbody>
                                                </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

            </main>
        </div>

        <footer class="app-footer">
                            &copy; 2021 <?php echo $rowtdk["sitename"];?>. All Rights Reserved
                        <div class="pull-right">
                Server time: <?php echo date('d-m-Y H:i:s',time());?>
            </div>
        </footer>

        <!-- Bootstrap and necessary plugins -->
        <script src="/js/backend.js?id=27298b157affa1f728a9"></script>

 </body>
</html>